package ru.uskov.trainer.datastore.impl;

import java.io.IOException;

import ru.uskov.trainer.datastore.IContext;

public class ContextGenerator {
  private static IContext instance;
  private static Object monitor = new Object();

  
  public static IContext getInstance() {
    if (instance == null) {
      synchronized (monitor) {
        if (instance == null) {
          try {
            instance = new Context();
          } catch (IOException e) {            
            e.printStackTrace();
            throw new RuntimeException("Unexpected exception");
          }
        } 
      }
    }
    return instance;
  }
  
}
